//
//  NSData+EDEncode.m
//  Demo_Encrypt
//
//  Created by ChenBing on 2020/3/9.
//

#import "NSData+EDEncode.h"

@implementation NSData (EDEncode)

- (NSString *)ed_utf8String {
    return [[NSString alloc] initWithData:self encoding:NSUTF8StringEncoding];
}

- (NSData *)ed_base64Encode {
    return [self base64EncodedDataWithOptions:NSDataBase64Encoding64CharacterLineLength];
}

- (NSData *)ed_base64Decode {
    return [[NSData alloc] initWithBase64EncodedData:self options:NSDataBase64DecodingIgnoreUnknownCharacters];
}

@end
